package me.zk.practice1.s;

import java.util.Arrays;

/**
 * @author zhangkai
 * @date 2023/7/6 11:08
 */
public class LS283 {

    public static void moveZeroes(int[] nums) {
        if (nums == null || nums.length == 0) return;
        int s = 0;
        for(int num : nums) {
            if (num!=0) {
                nums[s++] = num;
            }
        }
       while (s < nums.length) {
           nums[s++] = 0;
       }
        
    }

    public static void main(String[] args) {
        int[] nums = new int[]{0,1,0,3,12};
        moveZeroes(nums);
        System.out.println(Arrays.toString(nums));

    }
}
